package kwic.es;

import java.util.ArrayList;
import java.util.List;

public class Util {
	public static boolean match(String lineToDelete, String linePatternToDelete) {
		String[] words1 = lineToDelete.split(" ");
		List<String> wordList1 = new ArrayList<String>();
		for (int i = 0; i < words1.length; i++) {
			wordList1.add(words1[i]);
		}
		String[] words2 = linePatternToDelete.split(" ");
		List<String> wordList2 = new ArrayList<String>();
		for (int i = 0; i < words2.length; i++) {
			wordList2.add(words2[i]);
		}
		return (wordList1.containsAll(wordList2))
				&& (wordList2.containsAll(wordList1));
	}
}
